<template>
  <div class="redirect">
    <keep-alive>
      <router-view class="router-view" v-if="$route.meta.keepAlive"></router-view>
    </keep-alive>
    <router-view class="router-view" v-if="!$route.meta.keepAlive"></router-view>
  </div>
</template>
<script>
export default {
  data() {
    return {};
  },
  created() {
    this.$bus.emit('layout-router-moudle-change', this.$route.meta);
    let path = this.$route.params.path;
    let name = this.$route.params.name;
    if (path) {
      this.$router.push({ path: path });
      return;
    } else if (name) {
      let param = this.$route.params.param;
      this.$router.push({ name: name, params: param });
    }
  }
};
</script>
<style lang="scss" scoped>
.redirect {
  width: 100%;
  height: 100%;
  .router-view {
    height: calc(100% - 49px);
  }
}
</style>
